3.77 \(\int \frac{2+12 x+3 x^2}{(4+x^2)^2} \, dx\)

Optimal. Leaf size=27 \[ \frac{7}{8} \tan ^{-1}\left (\frac{x}{2}\right )-\frac{5 x+24}{4 \left (x^2+4\right )} \]

[Out]

-(24 + 5*x)/(4*(4 + x^2)) + (7*ArcTan[x/2])/8

________________________________________________________________________________________

Rubi [A]  time = 0.0139091, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {1814, 12, 203} \[ \frac{7}{8} \tan ^{-1}\left (\frac{x}{2}\right )-\frac{5 x+24}{4 \left (x^2+4\right )} \]

Antiderivative was successfully verified.

[In]

Int[(2 + 12*x + 3*x^2)/(4 + x^2)^2,x]

[Out]

-(24 + 5*x)/(4*(4 + x^2)) + (7*ArcTan[x/2])/8

Rule 1814

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[((a
*g - b*f*x)*(a + b*x^2)^(p + 1))/(2*a*b*(p + 1)), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{2+12 x+3 x^2}{\left (4+x^2\right )^2} \, dx &=-\frac{24+5 x}{4 \left (4+x^2\right )}-\frac{1}{8} \int -\frac{14}{4+x^2} \, dx\\ &=-\frac{24+5 x}{4 \left (4+x^2\right )}+\frac{7}{4} \int \frac{1}{4+x^2} \, dx\\ &=-\frac{24+5 x}{4 \left (4+x^2\right )}+\frac{7}{8} \tan ^{-1}\left (\frac{x}{2}\right )\\ \end{align*}

Mathematica [A]  time = 0.010329, size = 27, normalized size = 1. \[ \frac{-5 x-24}{4 \left (x^2+4\right )}+\frac{7}{8} \tan ^{-1}\left (\frac{x}{2}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(2 + 12*x + 3*x^2)/(4 + x^2)^2,x]

[Out]

(-24 - 5*x)/(4*(4 + x^2)) + (7*ArcTan[x/2])/8

________________________________________________________________________________________

Maple [A]  time = 0.048, size = 21, normalized size = 0.8 \begin{align*}{\frac{1}{{x}^{2}+4} \left ( -{\frac{5\,x}{4}}-6 \right ) }+{\frac{7}{8}\arctan \left ({\frac{x}{2}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((3*x^2+12*x+2)/(x^2+4)^2,x)

[Out]

(-5/4*x-6)/(x^2+4)+7/8*arctan(1/2*x)

________________________________________________________________________________________

Maxima [A]  time = 1.49413, size = 28, normalized size = 1.04 \begin{align*} -\frac{5 \, x + 24}{4 \,{\left (x^{2} + 4\right )}} + \frac{7}{8} \, \arctan \left (\frac{1}{2} \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^2+12*x+2)/(x^2+4)^2,x, algorithm="maxima")

[Out]

-1/4*(5*x + 24)/(x^2 + 4) + 7/8*arctan(1/2*x)

________________________________________________________________________________________

Fricas [A]  time = 1.0288, size = 74, normalized size = 2.74 \begin{align*} \frac{7 \,{\left (x^{2} + 4\right )} \arctan \left (\frac{1}{2} \, x\right ) - 10 \, x - 48}{8 \,{\left (x^{2} + 4\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^2+12*x+2)/(x^2+4)^2,x, algorithm="fricas")

[Out]

1/8*(7*(x^2 + 4)*arctan(1/2*x) - 10*x - 48)/(x^2 + 4)

________________________________________________________________________________________

Sympy [A]  time = 0.11676, size = 19, normalized size = 0.7 \begin{align*} - \frac{5 x + 24}{4 x^{2} + 16} + \frac{7 \operatorname{atan}{\left (\frac{x}{2} \right )}}{8} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x**2+12*x+2)/(x**2+4)**2,x)

[Out]

-(5*x + 24)/(4*x**2 + 16) + 7*atan(x/2)/8

________________________________________________________________________________________

Giac [A]  time = 1.17825, size = 28, normalized size = 1.04 \begin{align*} -\frac{5 \, x + 24}{4 \,{\left (x^{2} + 4\right )}} + \frac{7}{8} \, \arctan \left (\frac{1}{2} \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((3*x^2+12*x+2)/(x^2+4)^2,x, algorithm="giac")

[Out]

-1/4*(5*x + 24)/(x^2 + 4) + 7/8*arctan(1/2*x)